package com.newcoder.mapper;

import com.newcoder.entity.Comment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yjh
 * @since 2024-12-04 10:03:25
 */
@Mapper
public interface CommentMapper{
    // @Param注解用于给参数取别名,
    // 如果只有一个参数,并且在<if>里使用,则必须加别名.

    Integer selectCommentTotal(Integer entityType, Integer entityId);

    List<Comment> selectCommentsPage(Integer entityType, Integer entityId, Integer offset, Integer limit);

    Integer insertComment(Comment comment);

    Comment selectCommentById(Integer id);

    Integer deleteCommentById(Integer id);
}
